package com.ruoyi.system.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteFileService;
import com.ruoyi.system.api.domain.SysFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("priture")
@CrossOrigin
public class PictureController {

    @Autowired
    RemoteFileService remoteFileService;

    @PostMapping("upload")
    public SysFile upload(MultipartFile file){
        R<SysFile> upload = remoteFileService.upload(file);
        System.out.println(upload.getData());
        return upload.getData();
    }
}
